package com.java.test;
/**
* @author ClearScenery
* @version 创建时间：2019年3月8日 上午11:24:48
* @ClassName Outter
* @Description 测试不同修饰符的内部类实例创建方式
*/
public class Outter {
	public static void main(String[] args) {
		new Outter();
		
		Inner inner = new Outter().new Inner();//非静态，实例创建
		
		StaticInner staticInner = new Outter.StaticInner();//静态，类创建
		
		//new Outter.new StaticInner();//静态，类创建，编译失败
		
		PrivateInner privateInner = new Outter().new PrivateInner();//非静态，实例创建
		
		ProtectedInner protectedInner = new Outter().new ProtectedInner();//非静态，实例创建
		
		PublicInner publicInner = new Outter().new PublicInner();//非静态，实例创建
		
		Outter.StaticInner osi = new StaticInner(); 
		
		Outter.Inner oi = new Outter().new Inner();
	}
	
	class Inner{}
	
	static class StaticInner{}
	
	private class PrivateInner{}
	
	protected class ProtectedInner{}
	
	//default class DefaultInner{} //编译失败
	
	public class PublicInner{}
}
